package com.zoffy.catdiarybackend.model.vo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.zoffy.catdiarybackend.model.entity.User;
import lombok.Data;

import java.io.Serializable;

@Data
public class UserVo implements Serializable {
    private long id;
    private static final long SerialVersionUID=10000;

    /**
     * 账号
     */
    @TableField(value = "user_account")
    private String userAccount;


    /**
     * 用户昵称
     */
    @TableField(value = "user_name")
    private String userName;

    /**
     * 用户头像
     */
    @TableField(value = "user_avatar")
    private String userAvatar;

    /**
     * 用户简介
     */
    @TableField(value = "user_profile")
    private String userProfile;

    /**
     * 用户角色
     */
    @TableField(value = "user_role")
    private String userRole;

    /**
     * 用户状态
     */
    @TableField(value = "user_state")
    private String userState;
    public static UserVo obj2Vo(User user){
        UserVo userVo =new UserVo();
        userVo.setId(user.getId());
        userVo.setUserAccount(user.getUserAccount());
        userVo.setUserName(user.getUserName());
        userVo.setUserAvatar(user.getUserAvatar());
        userVo.setUserProfile(user.getUserProfile());
        userVo.setUserRole(user.getUserRole());
        userVo.setUserState(user.getUserState());
        return userVo;
    }
}
